import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const blankPage = (resolve) => {
  import('views/blankPage').then((module) => {
    resolve(module)
  })
}















const viewRouter = new Router({
  routes: [
    {
      path: '/',
      component: blankPage,
      meta: {
        title: '系统维护中...'
      }
    }

  ]
})

viewRouter.beforeEach((to, from, next) => {
  if (to.meta.title) {
    document.title = to.meta.title
  }
  let uid = to.query.uid || localStorage.getItem('uid');
  let token = to.query.token || localStorage.getItem('token');
  next()
  setTimeout(()=>{
    localStorage.setItem('uid', uid);
    localStorage.setItem('token', token);
  },40);
})


export default viewRouter
